import 'package:flutter_1911/model/common_model.dart';

//首页网格卡片
class GridModel {
  final GridItem hotel;
  final GridItem flight;
  final GridItem travel;

  GridModel(
      {required this.hotel, required this.flight, required this.travel});

  factory GridModel.fromJson(Map<String, dynamic> json) {
    return GridModel(
      hotel: GridItem.fromJson(json['hotel']),
      flight: GridItem.fromJson(json['flight']),
      travel: GridItem.fromJson(json['travel']),
    );
  }
}

class GridItem {
  final String startColor;
  final String endColor;
  final CommonModel mainItem;
  final CommonModel item1;
  final CommonModel item2;
  final CommonModel item3;
  final CommonModel item4;

  GridItem(
      {required this.startColor,
      required this.endColor,
      required this.mainItem,
      required this.item1,
      required this.item2,
      required this.item3,
      required this.item4});

  factory GridItem.fromJson(Map<String, dynamic> json) {
    return GridItem(
      startColor: json['startColor'],
      endColor: json['endColor'],
      mainItem: CommonModel.fromJson(json['mainItem']),
      item1: CommonModel.fromJson(json['item1']),
      item2: CommonModel.fromJson(json['item2']),
      item3: CommonModel.fromJson(json['item3']),
      item4: CommonModel.fromJson(json['item4']),
    );
  }
}
